import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";

export const getAllList = params => {
  return http.request("get", "/business/average-user/agents", params);
};
// 列表
export function getPageList(params) {
  return http.request("get", baseUrlApi("business/average_user/listBackstage"), { params });
}
// 签约税源地列表
export function listTaxSourcesRole(params?:any) {
  return http.request ("get", baseUrlApi("business/user_data_permissions/listTaxSourcesRole"), { params });
}
// 签约记录
export function listBackstage(params: any) {
  return http.request ("get", baseUrlApi("business/average_user_merchants_deal/listBackstage"), { params });
}
// 白名单列表 
export function whiteList(params: any) {
  return http.request ("get", baseUrlApi("/business/id_card_white/list"), { params });
}
// 添加白名单
export const whiteAdd = (params: any) => {
  return http.request("post",baseUrlApi("/business/id_card_white/add"), {
    data: params
  });
};
// 删除白名单 
export const whiteDelete = (id: number) => {
  return http.request( "delete", baseUrlApi(`business/id_card_white/remove/${id}`));
};

export const getSingle = (id: number) => {
  return http.request("get", `/business/average-user/${id}`);
};

export const deleteData = (id: number) => {
  return http.request("delete", `/business/average-user/${id}`);
};
// 灵工列表改变状态 
export const setFreeze = (params?: any) => {
  return http.request("post",baseUrlApi("business/average-user/setFreeze"), {
    data: params
  });
};
// 灵工详情
export const getInfoBackstage = (id: number) => {
  return http.request("get", baseUrlApi(`business/average_user/getInfoBackstage/${id}`));
};
// 员工详情 表格 
export function listAverageMerchants(params: any) {
  return http.request ("get", baseUrlApi("business/project_task/listAverageMerchants"), { params });
}
// 员工详情 添加身份证号 
export const addIDCardByBackstage = (params?: any) => {
  return http.request("post",baseUrlApi("business/average_user/addIDCardByBackstage"), {
    data: params
  });
};
// s员工详情删除身份证 
export const removeIDCardByBackstage = (id: number) => {
  return http.request("get", baseUrlApi(`business/average_user/removeIDCardByBackstage/${id}`));
};
// 签约记录查看协议 
export function checkTheAgreement(params: any) {
  return http.request ("get", baseUrlApi("business/average_user_merchants_deal/checkTheAgreement"), { params });
}